﻿using System;
using System.Collections.Generic;
using System.Text;
using DailyDiet.Services;
using DailyDiet.Services.Constant;
using DailyDiet.Services.Impl;
using Moq;
using NUnit.Framework;

namespace DailyDietTest.Helper
{
    public static class DietPictureServiceHelper {
        private static IDietPictureService _dietPictureService;
        
        public static IDietPictureService GetAInitializedGetDietPictureService() {
            if (_dietPictureService == null) {
                var preferenceMock = new Mock<IPreferenceStorage>();
                preferenceMock.Setup(p => p.Get(DietPictureConstant.BasePreferenceKey + 1,
                    DietPictureConstant.DefaultStorageState)).Returns(DietPictureConstant.InLocalFile); ;
                var mockedPreference2 = preferenceMock.Object;
                _dietPictureService =
                    new DietPictureService(mockedPreference2);
            }

            return _dietPictureService;
        }
    }
}
